#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "uthash.h"

#include <iso646.h>

int totalMoney(int n);

int main()
{
	return 0;
}

int totalMoney(int n)
{
	int weeks = n / 7, remainder = n % 7;

	return (7 * weeks + 49) * n / 2 + (1 + remainder) * remainder / 2 + weeks * remainder;
}
